
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ page contentType="text/html; charset=UTF-8"%>
<TITLE>User Manager</TITLE>
<STYLE type="text/css">
USERDETAILS.TABLE
{
margin:20px;
}
amexLogo.TABLE
{
margin:20px;
border:5px;
}
#hline.hr
{
vertical-align: top;
}
Shortcuts.a{
background-color: #000066;
width: 100%;
display: block;
text-indent: 0px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
text-align: left;
font-weight: bold;
}
</STYLE>
<!--<LINK REL="STYLESHEET" TYPE="text/css" <web:resource type="style" attribute="HREF" name="../UserManager/style/UserManager.css"/>-->
<script language="javascript">
var selectedIndex;
var isSelected="false";
var SelectedRow;
function selectedRow(value)
{
//alert(value);
selectedIndex=value;
}
function goSearch()
{
	//alert("1");
	document.getElementById('searchResults').style.display='block';
	//return false;
}
function PendingRequest()
{
	//alert(document.getElementById('SearchResult').checked );
	//alert("1");
	//alert("2"+isSelected);
    if(isSelected == "false")
	{
		alert("Please select an entry");
		return false;
	}
	//alert("3"+isSelected);
	//if(document.getElementById('SearchResult').checked )
	//{
	
	//alert("4"+SelectedRow);
	document.ViewProfileForm.action="/giid/MCSUserProfile.do";
	//alert("5"+isSelected);
	document.ViewProfileForm.submit();
	//alert("6"+isSelected);
	return true;
	//}
}
function DeleteUser()
{
	if(isSelected == "false")
	{
		alert("Please select an entry");
		return false;
	}
	var answer =confirm("Are you sure you want to delete the User?");
	if(answer)
	{
		document.ViewProfileForm.action="/giid/DeleteUserProfile.do";
		document.ViewProfileForm.submit();
		//document.getElementById('displayResult').style.display='none';
		document.getElementById('searchValues0').style.display='none';
		document.getElementById('searchValues1').style.display='none';
		document.getElementById('searchValues2').style.display='none';
		document.getElementById('searchValues3').style.display='none';
		document.getElementById('searchValues4').style.display='none';
		document.getElementById('searchValues5').style.display='none';
		document.getElementById('PR').disabled=true;
		document.getElementById('DU').disabled=true;
		//document.getElementById('RG').disabled=true;
		document.getElementById('AU').disabled=true;
		document.getElementById('DEU').disabled=true;

	}
	else
	{
		//document.getElementById('displayResult').style.display='block';
	}
	return true;

}
function RemoveUser(selectedButton)
{
	if(isSelected == "false")
	{
		alert("Please select an entry");
		return false;
	}
	//window.open("RemoveUserGroup.html","NewEntry","menubar=0,resizable=0,width=500,height=500");
	if(selectedButton == 'AU')
	{
		var answer = confirm("Are you sure you want to activate this user?");
		if(answer)
		{
		
			document.ViewProfileForm.action="/giid/ActivateUserProfile.do";
			document.ViewProfileForm.submit();	
			//alert("User Activated");
		}
	}
	if(selectedButton == 'DEU')
	{
		var answer = confirm("Are you sure you want to de-activate this user?");
		if(answer)
		{
			document.ViewProfileForm.action="/giid/DeactivateUserProfile.do";
			document.ViewProfileForm.submit();
			//alert("User De-Activated");
		}
	}
	
	return true;
}
function ShowResult()
{
	if(document.getElementById('SearchValue').value == 0 )
	{
		alert('Search field cannot be left blank');
		document.getElementById('SearchValue').focus();
		document.getElementById('SearchValueError').style.display='block';
		return false;
	}
	else
	{
		document.getElementById('SearchValueError').style.display='none';
		document.getElementById('displayResult').style.display='block';
		document.getElementById('searchValues0').style.display='block';
		document.getElementById('searchValues1').style.display='block';
		document.getElementById('searchValues2').style.display='block';
		document.getElementById('searchValues3').style.display='block';
		document.getElementById('searchValues4').style.display='block';
		document.getElementById('searchValues5').style.display='block';
		return true;
	}
	
}
function ShowResult1()
{
		//alert(document.getElementById('SearchValue').value);
		if(document.getElementById('SearchValue').value=='')
		{
			alert('Please enter a value to search');
			document.getElementById('SearchValue').focus();
			document.getElementById('SearchValueError').style.display='block';
			return false;
		}
		/*document.getElementById('SearchValueError').style.display='none';
		document.getElementById('displayResult').style.display='block';`
		document.getElementById('searchValues0').style.display='block';
		document.getElementById('searchValues1').style.display='block';
		document.getElementById('searchValues2').style.display='block';
		document.getElementById('searchValues3').style.display='block';
		document.getElementById('searchValues4').style.display='block';
		document.getElementById('searchValues5').style.display='block';*/
		document.searchForm.submit();
		return true;
	
	
}
function SearchBoxHide()
{
	//alert("1");
	if(document.searchForm.searchAttribute.value =='AP' || document.searchForm.searchAttribute.value =='EAP' )
	{
		document.getElementById('EqualsDiv').style.display = 'none';
		document.getElementById('SearchBox').style.display = 'none';
		document.getElementById('SearchButton1').style.display = 'block';
		document.getElementById('SearchButton').style.display = 'none';
		
	}
	else
	{
		document.getElementById('EqualsDiv').style.display = 'block';
		document.getElementById('SearchBox').style.display = 'block';
		document.getElementById('SearchButton1').style.display = 'none';
		document.getElementById('SearchButton').style.display = 'block';
	}
}
function ClearField()
{
	document.getElementById('SearchValue').value='';
	document.location.href="/giid/UserManagerClear.do";
}
function SelectEntry(value,name,id,row,useradminCode)
{
	document.getElementById('AU').disabled=false;
	document.getElementById('DEU').disabled=false;
//alert("value>ECNId"+id);
//alert("name>fullname"+name);
//alert("id>amexwebid"+value);
//alert(useradminCode);

if(useradminCode == '06' || useradminCode == '07' )
{
	document.getElementById('DEU').disabled=true;
	document.getElementById('DU').disabled=false;
	document.getElementById('PR').disabled=false;
	
}
else if(useradminCode == '01' || useradminCode == '02')
{
	document.getElementById('AU').disabled=true;
	document.getElementById('DU').disabled=true;
	document.getElementById('DEU').disabled=true;
	document.getElementById('PR').disabled=false;
}
else if(!(useradminCode == '06') || !(useradminCode == '07'))
{
	document.getElementById('AU').disabled=true;
	document.getElementById('DU').disabled=false;
	document.getElementById('PR').disabled=false;
}
else
{
	document.getElementById('AU').disabled=false;
	document.getElementById('DEU').disabled=false;
	document.getElementById('DU').disabled=false;
	document.getElementById('PR').disabled=false;
}
document.getElementById('hiddenECNId').value=id;
document.getElementById('hiddenFullName').value=name;
document.getElementById('hiddenAmexWebId').value=value;
isSelected="true";
SelectedRow = row;
}
function ConfirmMCSAction()
{
	if(document.getElementById('confirmdeleteuser').value =='Y')
	{
		alert("User Deleted");
	}
	if(document.getElementById('confirmdeactivateuser').value =='Y')
	{
		alert("User Deactivated");
	}
	if(document.getElementById('confirmactivateuser').value =='Y')
	{
		alert("User Activated");
	}		
}
</script>
</HEAD>

<BODY leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
<TABLE class="Shortcuts" width="1300" bgcolor="#000066" style="leftmargin: 0px;">
<TR bgcolor="#000066">

<td height="17px" width="100">
<a href="/giid/jsp/customizedPages/RedirectRequest.jsp" ><font style="font-family:Arial; text-decoration: none; font-size: 0.75em" color="white"><b>Projects Home</b></a>
</td>
 
<!-- REQ : 003 Team Co-ordinator delegate assignment -->
<!-- Updated by Mahesh Patil  -->
<!-- START -->
<td height="17px" width="175">
<a href="/giid/jsp/customizedPages/SearchDelegationRequest.jsp" ><font style="font-family:Arial; text-decoration: none; font-size: 0.75em" color="white"><b>Search Delegation Request</b></a>
</td>
<!-- END -->
<td height="17px" width="100">
<a href="/giid/jsp/customizedPages/MARCAllEvent.jsp" ><font style="font-family:Arial; text-decoration: none; font-size: 0.75em" color="white"><b>MARC Events</b></a>
</td>
<td height="17px" width="100">
<a href="/giid/jsp/customizedPages/SharedFolder.jsp" ><font style="font-family:Arial; text-decoration: none; font-size: 0.75em" color="white"><b>Create Shared Folder</b></a>
</td>
<td height="17px" align="left">
<a href="/giid/jsp/customizedPages/logoutTemplate.jsp"><font style="font-family:Arial; text-decoration: none; font-size: 0.75em" color="white"><b>Logout</b></font></a>
</td>
</TR>
</TABLE>
<TABLE width="1300" class="amexLogo">
<TR>
<td>
<img src="/giid/images/amexheader.gif"/>
</td>
</TR>
<tr valign="top" ><td valign="top" height="1px"><hr class="hline" width="1300"></td></tr>
</TABLE>
<form name="searchForm" action="/giid/SearchResults.do" method="POST">
<TABLE BGCOLOR="#CCCCCC" width="1300" HEIGHT="15" BORDER="0" CELLSPACING="0" CELLPADDING="0">
			<TR>
				<TD>
				
						<input type="hidden" name="confirmdeleteuser" id="confirmdeleteuser" value="Y" />
				
						<input type="hidden" name="confirmdeleteuser" id="confirmdeleteuser" value="N" />
				
						<input type="hidden" name="confirmdeactivateuser" id="confirmdeactivateuser" value="Y" />
				
						<input type="hidden" name="confirmdeactivateuser" id="confirmdeactivateuser" value="N" />
				
						<input type="hidden" name="confirmactivateuser" id="confirmactivateuser" value="Y" />
				
						<input type="hidden" name="confirmactivateuser" id="confirmactivateuser" value="N" />
				
				</TD>
			</TR>
            <TR>
                <!--<TD ROWSPAN="3"><IMG <web:resource attribute="SRC" name="1ptrans.gif"/> ALT="" WIDTH="4" HEIGHT="1" /></TD>-->
                <TD width="15%"><font style="font-weight: bold;">&nbsp;&nbsp;Search using :</font></TD>
            </TR>
            <TR>
                <TD width="20%">
                	<select name="searchAttribute" onclick="SearchBoxHide()">
                		
                		<option value="USER_LST_NM" selected>Last Name</option>
                		
                		<option value="USER_LST_NM">Last Name</option>
                		
                					<option value="USER_ID" selected>Employee/Contractor ID</option>
                		
                					<option value="USER_ID" >Employee/Contractor ID</option>
                		
                		<option value="USER_1ST_NM" selected>First Name</option>
                		
                					<option value="USER_1ST_NM">First Name</option>
                					
                			
                		<option value="WORKFORCE_MBR_ID" selected>AmexWeb Id</option>
                		
                					<option value="WORKFORCE_MBR_ID">AmexWeb Id</option>
                		
						<!--
						<option value="AP" onclick="SearchBoxHide()">Pending Approvals</option>
						<option value="EAP" onclick="SearchBoxHide()">Exception Pending Approvals</option>
						-->
						
						<option value="USER_LST_NM">Last Name</option>
						<option value="USER_ID" >Employee/Contractor ID</option>
						<option value="USER_1ST_NM">First Name</option>
						<option value="WORKFORCE_MBR_ID">AmexWeb Id</option>
						<!--
						<option value="AP" onclick="SearchBoxHide()">Pending Approvals</option>
						<option value="EAP" onclick="SearchBoxHide()">Exception Pending Approvals</option>
						-->
						
                	</select>
                </TD>
				<TD>
					<div id="SearchButton1" style="display:none">
                		<input type="submit" name="GO"  onclick=" return ShowResult1();" value="Search >" />
					</div>
                </TD>
                <TD width="8%">
					<div id="EqualsDiv" style="display:block">
        				<font style="font-weight: bold;">&nbsp;&nbsp;Equals :</font>
					</div>
                </TD>
                <TD width="20%">
					<div id="SearchBox" style="display:block">
						
                		<input type="text" name="SearchValue"  id="SearchValue" value=""/>
                		
                		<input type="text" name="SearchValue"  id="SearchValue"/>
                		
					</div>
                </TD>
                <TD>
					<div id="SearchButton" style="display:block">
                		<input type="submit" name="GO"  onclick="return ShowResult1();" value="Search >" />
                		<input type="button" name="Clear" id="Clear" onclick="ClearField()" value="Clear >" />
					</div>
					<div id="ClearButton" style="display:block">
                		
					</div>
                </TD>
                <TD>
					
                </TD>
            </TR>
            <TR>
				<td>
				</td>
				<td>
				</td>
				<td>
				</td>
                <TD>
					<div id="SearchValueError" style="display:none">
						<font color="Red" size="2">Please enter a value to search</font>
					</div>
                </TD>
            </TR>
			<TR>
                <TD>
                </TD>
            </TR>
            
</table>
</form>
  
   
<table name="displaySearchResults" width="1300">
	<TR  align="center">
		<TD width="3%"></TD>
		<TD bgcolor="#99CCFF" width="9%"><font
			size="2">AMEX Web ID</font></TD>
		<TD bgcolor="#99CCFF" width="12%"><font
			size="2">Full Name </font></TD>
		<TD bgcolor="#99CCFF" width="12%"><font
			size="2">Employee/Contractor # </font></TD>
		<TD bgcolor="#99CCFF" width="14%"><font
			size="2">Department/Team</font></TD>
		<TD bgcolor="#99CCFF" width="9%"><font
			size="2">Business Unit</font></TD>
		<TD bgcolor="#99CCFF" width="9%"><font
			size="2">Cost Center </font></TD>
		<TD bgcolor="#99CCFF" width="9%"><font
			size="2">Phone #</font></TD>
		<TD bgcolor="#99CCFF" width="14%"><font
			size="2">Email Address </font></TD>
		<TD bgcolor="#99CCFF" width="9%"><font
			size="2">Manager's Name </font></TD>
	</TR>
	
    <TR align="center" id="1">
		<TD width="3%">
		<div id="searchValues0" style="display: block">
			
			<input type="radio" name="SearchResult" id="SearchResult" onclick="SelectEntry('','','','','')" />
		</div>
		</TD>
		<TD width="9%">
		<div id="searchValues1" style="display: block"><font size="2"
			></font></div>
		</TD>
		
		<TD width="12%">
		<div id="searchValues2" style="display: block"><font size="2" color="#3399FF"></font>
		</div>
		</TD>
		
		<TD width="12%">
		<div id="searchValues3" style="display: block"><font size="2"></font>
		</div>
		</TD>
		
		<TD width="14%">
		<div id="searchValues3" style="display: block"><font size="2"></font>
		</div>
		</TD>
		
		<TD width="9%">
		<div id="searchValues3" style="display: block"><font size="2"></font>
		</div>
		</TD>
		
		<TD width="9%">
		<div id="searchValues4" style="display: block"><font size="2"></font></div>
		</TD>
		
		<TD width="9%">
		<div id="searchValues5" style="display: block"><font size="2"></font>
		</div>
		</TD>
		
		<TD width="14%">
		<div id="searchValues5" style="display: block"><font size="2"><a
			href='mailto:'></a></font>
		</div>
		</TD>
		
		<TD width="9%">
		<div id="searchValues5" style="display: block"><font size="2"></font></div>
		</TD>
		
	</TR>
   
   		</TABLE>
   		<TABLE ALIGN="CENTER">
   		<TR>
   			<TD>
   				<font style="font-weight: bold;" color="blue">No results found.</font>
   			</TD>
   		</TR>
   		
   		</TABLE>  		

   <form name="ViewProfileForm" method="POST">
   <table>
	<TR>
   			<TD>
   				<INPUT TYPE="HIDDEN" NAME="hiddenECNId" id="hiddenECNId" value ="1" />
   			</TD>
   			<TD>
   				<INPUT TYPE="HIDDEN" NAME="hiddenAmexWebId" id="hiddenAmexWebId" value ="2" />
   			</TD>
   			<Td>
   				<INPUT TYPE="HIDDEN" NAME="hiddenFullName" id="hiddenFullName" value="3" />
   			</TD>
   	</TR>
   	</table>
   	</form>
</table>
<table align="right">
	<TR>
		<TD>
			<INPUT TYPE="BUTTON" ID="PR" NAME="PR" VALUE="View User Profile" onclick="PendingRequest()" disabled=disabled/>
		</TD>
		<TD>
			<INPUT TYPE="BUTTON" ID="DU" NAME="DU" VALUE="Delete User" onclick="DeleteUser()"disabled=disabled/>
		</TD>	
		<TD>

			<INPUT TYPE="BUTTON" ID="AU" NAME="AU" id ="AU" VALUE="Activate User" onclick="RemoveUser(this.id)" disabled=disabled/>


		</TD>
		<TD>
				<INPUT TYPE="BUTTON" ID="DEU" NAME="DEU" id="DEU" VALUE="De-Activate User" onclick="RemoveUser(this.id)" disabled=disabled/>
		</TD>
   </TR>
   <tr>
   <br/>
   </tr>
</table>
</div>
<table width="100%" class="amexLogo" >
<tr valign="top" ><td valign="top"><hr  class="hline" width="1300"></td></tr>
<tr align="center">
	<td>
	<font size="2"></font>
	</td>
</tr>
</table>
</BODY>
</HTML>
<script language="javascript" type="text/javascript">
	window.onload=ConfirmMCSAction;
</script>
